package cn.lstf666.springboot.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

@Controller
public class UserController {

    @RequestMapping("/user/detail")
    public @ResponseBody Object userDetail(){
        Map<String,Object> rMap = new HashMap<String,Object>();
        rMap.put("id",1001);
        rMap.put("name","lisi");

        return rMap;
    }

    @RequestMapping("/user/page/detail")
    public String   userPageDetail(Model model){
       model.addAttribute("id",1002);
       model.addAttribute("name","wangwu");
        return "user";
    }
}
